includes:
    - /composer/vendor/phpstan/phpstan-webmozart-assert/extension.neon
    - ./vendor/phpdocumentor/graphviz/extension.neon

parameters:
  level: 6
  inferPrivatePropertyTypeFromConstructor: true
  treatPhpDocTypesAsCertain: false
  ignoreErrors:
    # PHPStan does not play nice with Symfony Config's fluid interface
    - '#.*NodeDefinition::prototype.*#'
    - '#.*NodeDefinition::addDefaultChildrenIfNoneSet.*#'
    - '#.*NodeDefinition::fixXmlConfig.*#'
    - '#.*NodeDefinition::addDefaultsIfNotSet.*#'

    # FlyFinder plugin adds a find method to FlySystem's Filesystem
    - '#Call to an undefined method League\\Flysystem\\Filesystem::find\(\)#'
    - '#Call to an undefined method League\\Flysystem\\FilesystemInterface::find\(\)#'

    # Bad design of descriptors.
    - '#Access to an undefined property phpDocumentor\\Descriptor\\Collection<phpDocumentor\\Descriptor\\Collection<phpDocumentor\\Descriptor\\DescriptorAbstract>>::\$[a-z]+#'
    # https://github.com/phpDocumentor/phpDocumentor/issues/2279
    - '#Instanceof between phpDocumentor\\Descriptor\\Collection<phpDocumentor\\Descriptor\\InterfaceDescriptor\|phpDocumentor\\Reflection\\Fqsen>\|phpDocumentor\\Reflection\\Fqsen\|string\|null and phpDocumentor\\Descriptor\\InterfaceDescriptor will always evaluate to false\.#'
    # PHPStan doesn't support @template D of T but will still complain if we put a D in a Collection of T !
    - '#Parameter \#2 \$value of method phpDocumentor\\Descriptor\\Collection<T>::offsetSet\(\) expects T, D given\.#'

    # phpstan/phpstan/issues/3951
    - '#Method phpDocumentor\\Descriptor\\ProjectDescriptorBuilder::filterDescriptor\(\) should return TDescriptor of phpDocumentor\\Descriptor\\Descriptor\|null but returns phpDocumentor\\Descriptor\\Filter\\Filterable\|null\.#'

    # PHPStan doesn't support inheritance of TDescriptor
    - '#Parameter \#2 \$assembler of method phpDocumentor\\Descriptor\\Builder\\AssemblerFactory<TInput of object,TDescriptor of phpDocumentor\\Descriptor\\Descriptor>::(register|registerFallback)\(\) expects phpDocumentor\\Descriptor\\Builder\\AssemblerInterface.* given\.#'
    -
            message: "#^Parameter \\#1 \\$value of method phpDocumentor\\\\GraphViz\\\\Graph\\:\\:setCenter\\(\\) expects bool, string given\\.$#"
            count: 1
            path: src/phpDocumentor/Transformer/Writer/Graph/GraphVizClassDiagram.php

    -
            message: "#^Parameter \\#1 \\$value of method phpDocumentor\\\\GraphViz\\\\Graph\\:\\:setConcentrate\\(\\) expects bool, string given\\.$#"
            count: 1
            path: src/phpDocumentor/Transformer/Writer/Graph/GraphVizClassDiagram.php

    -
            message: "#^Parameter \\#1 \\$value of method phpDocumentor\\\\GraphViz\\\\Graph\\:\\:setRankSep\\(\\) expects float, string given\\.$#"
            count: 1
            path: src/phpDocumentor/Transformer/Writer/Graph/GraphVizClassDiagram.php

    -
            message: "#^Parameter \\#1 \\$value of method phpDocumentor\\\\GraphViz\\\\Node\\:\\:setFontSize\\(\\) expects float, string given\\.$#"
            count: 1
            path: src/phpDocumentor/Transformer/Writer/Graph/GraphVizClassDiagram.php

    -
            message: "#^Parameter \\#1 \\$value of method phpDocumentor\\\\GraphViz\\\\Graph\\:\\:setFontSize\\(\\) expects float, string given\\.$#"
            count: 1
            path: src/phpDocumentor/Transformer/Writer/Graph/GraphVizClassDiagram.php
  excludes_analyse:
   #test data
    - %currentWorkingDirectory%/tests/features/**/*.php
    - %currentWorkingDirectory%/tests/data/*.php
    - %currentWorkingDirectory%/tests/features/assets/**/*.php
    - %currentWorkingDirectory%/tests/ReferenceImplementation.php
   # needs adjustment of interface in phpDocumentor/reflection in order to be able to typehint the command
    - %currentWorkingDirectory%/src/phpDocumentor/Parser/Middleware/CacheMiddleware.php
   # phpunit TestCase while having to use a composer-global install ("Class PHPUnit\\Framework\\TestCase not found and could not be autoloaded")
    - %currentWorkingDirectory%/tests/unit/**/*.php
    - %currentWorkingDirectory%/tests/integration/**/*.php
    - %currentWorkingDirectory%/tests/functional/**/*.php
